package com.diaohw.module.file.obj.vo;

import com.diaohw.platform.common.util.ValueUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 用户上传表 VO
 *
 * @author D-Hw
 * @since 2024-11-05
 */
@Data
@Accessors(chain = true)
@Schema(name = "AccountFileDO VO", description = "用户上传表 VO")
public class AccountFileVO implements Serializable {


    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 主键ID
     */
    @Schema(description = "ID")
    private String id;

    /**
     * 文件名称
     */
    @Schema(description = "文件名称")
    private String filename;

    /**
     * 文件大小
     */
    @Schema(description = "文件大小")
    private Integer length;

    /**
     * 文件ID
     */
    @Schema(description = "文件ID")
    private String fileId;

    /**
     * 目录ID
     */
    @Schema(description = "目录ID")
    private String catalogId;

    /**
     * 文件后缀
     */
    @Schema(description = "文件后缀")
    private String ext;

    /**
     * 标签ID
     */
    @Schema(description = "标签ID")
    private List<TagVO> tags;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 上传时间
     */
    @Schema(description = "上传时间")
    private String uploadTime;

    /**
     * 上传人
     */
    @Schema(description = "上传人")
    private String updateUser;


    public String getFormat() {
        if (length == null) {
            return "";
        }
        return ValueUtil.formatSize(length);
    }
}
